package com.yami.shop.rights.common.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yami.shop.common.util.PageParam;
import com.yami.shop.rights.common.dao.RightsRecordMapper;
import com.yami.shop.rights.common.dto.RightsRecordDto;
import com.yami.shop.rights.common.service.RightsRecordService;
import com.yami.shop.rights.common.model.RightsRecord;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class RightsRecordServiceImpl extends ServiceImpl<RightsRecordMapper, RightsRecord> implements RightsRecordService {

    @Autowired
    private RightsRecordMapper rightsRecordMapper;

    @Override
    public IPage<RightsRecordDto> getRightsRecord(PageParam<RightsRecordDto> page, String userId, String type) {
        if("2".equals(type)){
            return rightsRecordMapper.getRightsUserRecord(page,userId,type);
        }else{
            return rightsRecordMapper.getRightsUserVerificationRecord(page,userId,type);
        }
    }
}
